﻿@model dynamic

@{
	string dialogTitle = (string)Model.Title;
	string dialogInfo = (string)Model.Info;
}

@{Html.SmartStore().Window()
		.Name("uploadpackage-window")
		.Title(dialogTitle)
		.Size(WindowSize.Large)
		.Content(@<text>
		<form enctype="multipart/form-data" method="POST" action="@Url.Action("UploadPackage", "Packaging")">
			<div class="alert alert-info">
				@dialogInfo
			</div>
			<div class="adminContent">
				<div class="adminRow">
					<div class="adminTitle">
						<div class="ctl-label">
							<label class="col-form-label" for="packagefile">@T("Admin.Packaging.Dialog.File"):</label>
						</div>
					</div>
					<div class="adminData">
						<input type="file" id="packagefile" name="packagefile" class="form-control-plaintext" />
					</div>
				</div>
			</div>
		</form>
		</text>)
		.FooterContent(@<text>
			<a href="#" class="btn btn-secondary btn-flat" data-dismiss="modal">
				<span>@T("Common.Cancel")</span>
			</a>
			<button id="uploadpackagesubmit" type="submit" class="btn btn-primary">
				<span>@T("Admin.Packaging.Dialog.Upload")</span>
			</button>
		</text>)
	  .Render();
}

<script>
	$(function () {
		$("#uploadpackagesubmit").click(function (e) {
			e.preventDefault();
			var btn = $(this);
			var win = $('#uploadpackage-window');
			win.find("form").submit();
		});
	});
</script>